<div>
  <p>
    <strong>Authorization </strong><br/>
    <span href="client_credentials" style="width:185px;height:32px;display:inline-block;background-color:#ccc;padding:10px 10px 10px 5px;text-align: center;vertical-align: middle;">Client Credential</span>  &nbsp; &nbsp;
    <a href="/authorization_code" style="width:185px;height:32px;display:inline-block;background-color:#ccc;padding:10px 10px 10px 5px;text-align: center;vertical-align: middle;">Authorization Code</a>
  </p>
</div>

<div class="content">
  <ol>
      <% if session["ClientCredential"].nil? %>
        <li><b>1.</b>
          <a href="/client_credentials/login">Login</a>
          <code>
<pre>
clientcredential_config = ClientCredentialConfiguration.new(config);
connection = ADPApiConnectionFactory::createConnection(clientcredential_config)
connection.connect();
</pre>
          </code>
          </li>
      <% end %>
      <% if !session["ClientCredential"].nil? %>
        <li><b>1.</b>
          <a>Logged in</a>
          <code>
<pre>
clientcredential_config = ClientCredentialConfiguration.new(config);
connection = ADPApiConnectionFactory::createConnection(clientcredential_config)
connection.connect();
</pre>
          </code>
        </li>
        <br/>
          <li><b>2.</b>
          <a href="/client_credentials/logout">Logout</a>
          <br/>
          <code>

            connection.logout()

          </code>
          </li>
      <% end %>
    <br/>
    <!-- <li><b>2.</b> <a>Get Data</a></li> -->
    <br/>
  </ol>
</div>

<div class="sidebar">
  <h3>Results...</h3>
  <ul>
    <!--
    <li><b>Ruby:</b> <%= RUBY_VERSION %></li>
    <li><b>Environment:</b> <%= ENV["RACK_ENV"] %></li>
    <li><b>Server:</b> <%= @env["SERVER_SOFTWARE"] %></li>
    <li><b>Port:</b> <%= @env["SERVER_PORT"] %></li>
    -->

    <% if session["ClientCredential"].nil? || session["ClientCredential"].access_token.nil? %>
        <li><b>Access token:</b> not logged in</li>
    <% else %>
        <li><b>Access token:</b> <%= session["ClientCredential"].access_token.token %> </li>
        <li><b>Token type:</b> <%= session["ClientCredential"].access_token.token_type %> </li>
        <li><b>Expires in:</b> <%= session["ClientCredential"].access_token.expires_in %> </li>
        <li><b>Scope:</b> <%= session["ClientCredential"].access_token.scope %> </li>
        <li><b>Expires on:</b> <%= session["ClientCredential"].access_token.expires_on %> </li>
    <% end %>
    <li>&nbsp;</li>
  </ul>

  <div class="results_footer">
    <a href="https://github.com/adplabs/adp-connection-ruby"><img class="sidebar_logo" src="/images/ADP_logo_tagline.png" alt="Marketplace/Ruby/Library" /></a>
  </div>
</div>
